﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="ajaxService_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#sendMessage").click(function (e) {

                var getPostData = function () {
                    return {
                        title: "测试一下啦",
                        content: "sdasdasdasd 阿斯顿阿斯顿阿斯顿asdaa阿斯顿阿斯顿"
                    }
                }

                $.ajax({
                    type: "POST",
                    data: getPostData(),
                    url: "FeedbackHandler.ashx",
                    success: function (data) {
                        if (data == "success") {
                            alert("success");
                        }
                        else {
                            alert(data);
                        }
                    },
                    error: function () {
                        alert("error");
                    }
                });



            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <input type="button" id="sendMessage" value="sendMessage" />
    </div>
    </form>
</body>
</html>
